var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var corejs_path=[
    './mobileFront/resource/core/js/src/zepto.1.1.3.min.js',
    './mobileFront/resource/core/js/src/template-native.js',
    './mobileFront/resource/core/js/src/request.js',
    './mobileFront/resource/core/js/src/util.js',
    './mobileFront/resource/core/js/src/oauth.js',
    './mobileFront/resource/core/js/src/appViewBase.js'
];
gulp.task('bd', function() {
    return gulp.src(corejs_path)
                .pipe(concat('core.all.js'))
                //.pipe(uglify())
                .pipe(rename('core.min.js'))
                .pipe(gulp.dest('./mobileFront/resource/core/js/assets'))
});
gulp.task('build', ['bd']); 
// 监视文件的变化
gulp.task('watch', function () {
    gulp.watch('./mobileFront/resource/core/js/src/*.js', ['bd']);
});
gulp.task('default', ['watch']);